package top.saybook.exception;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@ControllerAdvice
public class MyException {

    @ExceptionHandler(Exception.class)
    public void exceptionHandler(HttpServletResponse response) throws IOException {
        response.sendRedirect("/404.html");
    }
}
